﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
using Microsoft.Xna.Framework.Net;
using Microsoft.Xna.Framework.Storage;

namespace odinshrine
{
    class Armerie
    {
        public static Arme Deagle, AK47, Famas, Pompe, MG;

        public Armerie()
        {
        }

        public void Load()
        {
            AK47 = new Arme(100, 3, 700, 1, 0, 0, 100, 1);
            Deagle = new Arme(450,7,500,1,0,0,-1, 2);
            Famas = new Arme(950, 5, 700, 3,10, 0, 200, 3);
            Pompe = new Arme(950, 1, 200, 17, 9999, (float) Math.PI / 5, 100, 4);
            MG = new Arme(200, 2, 400, 10, 9999, (float)Math.PI / 10, 400, 5);
        }
        public void Load(ContentManager content)
        {
            AK47 = new Arme(content.Load<Texture2D>("images/balle"), 100, 3, 700, 1, 1, (float)Math.PI / 40, 100, 1);
            Deagle = new Arme(content.Load<Texture2D>("images/balle"), 650, 7, 500, 1, 1, 0, 60, 2);
            Famas = new Arme(content.Load<Texture2D>("images/balle"),750, 5, 700, 3, 10, 0, 200, 3);
            Pompe = new Arme(content.Load<Texture2D>("images/balle"), 800, 2, 150, 7, 99999999, (float)Math.PI / 5, 100, 4);
            MG = new Arme(content.Load<Texture2D>("images/balle"), 200, 2, 700, 10, 9999, (float)Math.PI / 30, 400, 5);
        }

        public static void changerArme(KeyboardState clavier, Humain guy)
        {
            if (clavier.IsKeyDown(Keys.D1))
            {
                guy.arme = AK47;
                guy.ammo = guy.arme.maxAmmo;
            }

            if (clavier.IsKeyDown(Keys.D2))
            {
                guy.arme = Deagle;
                guy.ammo = guy.arme.maxAmmo;
            }
            if (clavier.IsKeyDown(Keys.D3))
            {
                guy.arme = Famas;
                guy.ammo = guy.arme.maxAmmo;
            }
            if (clavier.IsKeyDown(Keys.D4))
            {
                guy.arme = Pompe;
                guy.ammo = guy.arme.maxAmmo;
            }
            if (clavier.IsKeyDown(Keys.D5))
            {
                guy.arme = MG;
                guy.ammo = guy.arme.maxAmmo;
            }

        }

        public static void changeWeapon(Arme arme, Humain guy)
        {
            guy.arme = arme;
        }
    }
}
